home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / src / exampleCode / opengl / GLUT / progs / examples / stereo.c < prev    next >
C/C++ Source or Header  |  1996-11-11  |  808b  |  33 lines

  1.  
  2. /* Copyright (c) Mark J. Kilgard, 1994. */
  3.  
  4. /* This program is freely distributable without licensing fees 
  5.    and is provided without guarantee or warrantee expressed or 
  6.    implied. This program is -not- in the public domain. */
  7.  
  8. #include <stdlib.h>
  9. #include <stdio.h>
  10. #include <GL/glut.h>
  11.  
  12. void
  13. display(void)
  14. {
  15.   glDrawBuffer(GL_BACK_LEFT);
  16.   glClearColor(1.0, 0.0, 0.0, 1.0); /* red */
  17.   glClear(GL_COLOR_BUFFER_BIT);
  18.   glDrawBuffer(GL_BACK_RIGHT);
  19.   glClearColor(0.0, 0.0, 1.0, 1.0); /* blue */
  20.   glClear(GL_COLOR_BUFFER_BIT);
  21. }
  22.  
  23. int
  24. main(int argc, char **argv)
  25. {
  26.   glutInit(&argc, argv);
  27.   glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_STEREO);
  28.   glutCreateWindow("stereo example");
  29.   glutDisplayFunc(display);
  30.   glutMainLoop();
  31.   return 0;             /* ANSI C requires main to return int. */
  32. }
  33.